package keer.httpinterface.test.demo;

import keer.httpinterface.HttpFile;
import keer.httpinterface.annotation.PathArg;

import java.util.Arrays;
import java.util.List;

public class DemoParam {
    @PathArg
    private String name;
    private int age;
    private List<String> aliases;
//    private HttpFile file;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public List<String> getAliases() {
        return aliases;
    }

    public void setAliases(List<String> aliases) {
        this.aliases = aliases;
    }

//    public HttpFile getFile() {
//        return file;
//    }
//
//    public void setFile(HttpFile file) {
//        this.file = file;
//    }

    public static DemoParam create(String name, int age, String... alias) {
        return create(name, age, null, alias);
    }

    public static DemoParam create(String name, int age, HttpFile file, String... alias) {
        DemoParam param = new DemoParam();
        param.setName(name);
        param.setAge(age);
        param.setAliases(Arrays.asList(alias));
//        param.setFile(file);
        return param;
    }

    @Override
    public String toString() {
        return "name=" + name
                + ",age=" + age
                + ",aliases:" + (aliases == null ? "[]" : aliases.toString());
    }
}
